package com.childmiles.gwt.client.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AwardWinner implements Serializable {
    private String defaultPhotoURL = "/images/defaultAwardWinnerImage.jpg";
	private String name;
	private Date birthday;
	private String photoUrl;
	private Awards awards = new Awards();	
	public AwardWinner() {
	}
	
	public AwardWinner(String awardWinnerName) {
        name=awardWinnerName;
        photoUrl = defaultPhotoURL;
    }

    public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getPhotoUrl() {
		return photoUrl;
	}
	public void setPhotoUrl(String photoUrl) {
		this.photoUrl = photoUrl;
	}
	public Awards getAwards() {
		return awards;
	}
	
	public List<Award> getAwardsForDay(Integer dayNumber) {
	    return awards.get(dayNumber);
	}
	public void setAwards(Awards awards) {
		this.awards = awards;
	}

	/**
	 * Only use name for comparison
	 */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        return result;
    }

    /**
     * Only use name for comparison
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        AwardWinner other = (AwardWinner) obj;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equals(other.name))
            return false;
        return true;
    }
	
	
	
}
